<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html" xmlns:p="http://primefaces.org/ui"
	xmlns:f="http://java.sun.com/jsf/core" xmlns:sec="http://br.facet.tcc.utils/security-tags">
<h:head>
	<style type="text/css">
.companyHeaderGrid tr,.companyHeaderGrid td {
	border: none;
}
</style>
</h:head>
<ui:decorate template="/template/template.xhtml">
	<ui:define name="content">
		<p:growl id="growl" showDetail="true" autoUpdate="true" />
		<h:form id="formMatricula">
				<p:panel id="pesquisaAluno" header="Matricula" style="text-align: left;">
					<h:panelGrid columns="2" cellpadding="5">
						<h:outputLabel value="Aluno :" for="alunoMatricula" />
						<p:autoComplete value="#{matriculaMB.aluno}" id="alunoMatricula"
							completeMethod="#{matriculaMB.completeAluno}" var="a" itemLabel="#{a.aluno.nome}"
							itemValue="#{a}" converter="#{alunoConverter}" size="30">
							<p:ajax event="itemSelect" update="turmasMAtricula" listener="#{matriculaMB.buscarTurmas}" />
						</p:autoComplete>
						
						<h:outputLabel value="Turmas :" for="turmasMAtricula" />
						<p:selectManyCheckbox id="turmasMAtricula" value="#{matriculaMB.turmasSelecionadas}"
							converter="#{turmaConverter}" layout="pageDirection">
							<f:selectItems value="#{matriculaMB.turmasListadas}" var="turma"
								itemLabel="#{turma}" itemValue="#{turma}"  />
						</p:selectManyCheckbox>						

						<p:commandButton id="btnMatricular" value="Confirmar" action="#{matriculaMB.matricularAluno}"
							update=":formMatricula:pesquisaAluno" icon="ui-icon-disk" />
					</h:panelGrid>
				</p:panel>
		</h:form>
	</ui:define>
</ui:decorate>
</html>